<?php

/**
 * 活动列表页
 */
class CategroyAction extends BaseAction
{

    public function _empty()
    {

        $pinyin = $_GET['pinyin'];
        $region = $_GET['region'];

        import("@.ORG.Page");
        $condition['parentId'] = Cookie::get('city');
        $regions = D("Region")->where($condition)->select();
        $categroy = D("Categroy")->getByPinyin($pinyin);
        if ($region) {
            $map['region.pinyin'] = $region;
        }
        $map['activity.cateId'] = $categroy['id'];
        $map['region.parentId'] =  Cookie::get('city');
        $Activity = D("ActivityView");

        $count = $Activity->where($map)->count();
        $Page = new Page($count, 10);
        //$Activity = $Activity->where($map)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
        $Activity = $Activity->select();

        $show = $Page->show();
        $this->assign('pages', $show);
        $this->assign("Activity", $Activity);
        
        $this->assign("regions", $regions);
        $this->assign($categroy);
        $this->display("Categroy:index");
    }

}

?>